package Solutions


func checkDistances(s string, distance []int) bool {
    var mp=make([]int,26)
    for i:=0;i<26;i++{
        mp[i]=-1
    }
    for i:=0;i<len(s);i++{
        if mp[s[i]-'a']!=-1{
            if distance[s[i]-'a']!=i-mp[s[i]-'a']-1{
                return false
            }
        }else{
            mp[s[i]-'a']=i
        }
    }
    return true
}